package org.qiyu.live.provider.sku;

import jakarta.annotation.Resource;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.qiyu.live.interfaces.sku.rpc.ISkuStockInfoRPC;
import org.qiyu.live.provider.sku.entity.SkuStockInfo;
import org.qiyu.live.provider.sku.service.ISkuStockInfoService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.Arrays;
import java.util.List;

/**
 * @Author idea
 * @Date: Created in 14:49 2023/7/30
 * @Description
 */
@SpringBootApplication
@EnableDubbo
@MapperScan("org.qiyu.live.provider.sku.mapper")
public class SkuProviderApplication implements CommandLineRunner {

    public static void main(String[] args) {
//        SpringApplication springApplication = new SpringApplication(SkuProviderApplication.class);
//        springApplication.setWebApplicationType(WebApplicationType.SERVLET);
//        springApplication.run(args);
        SpringApplication.run(SkuProviderApplication.class, args);
    }

//    @Resource
//    ISkuStockInfoRPC skuStockInfoRPC;

    @Override
    public void run(String... args) throws Exception {
//        skuStockInfoRPC.prepareStockInfo(133002L);
//        for (int i = 0; i < 11; i++) {
//            boolean isSuccess = skuStockInfoRPC.dcrStockNumBySkuIdCache(90713L, 10);
//            System.out.println("isSuccess: " + isSuccess);
//        }
    }
}
